﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Snom.Tests.Properties;
using System.Collections.Specialized;

namespace Snom.Tests
{
    [TestClass]
    public class SettingsTests
    {
        [TestMethod]
        public void GetSettings()
        {
            using (SnomPhone snomPhone = new SnomPhone(Settings.Default.MyPhoneIpAddress))
            {
                NameValueCollection settings = snomPhone.GetSettings();
                Assert.AreEqual(1824, settings.Count);
            }
        }

        [TestMethod]
        public void GetSetting()
        {
            using (SnomPhone snomPhone = new SnomPhone(Settings.Default.MyPhoneIpAddress))
            {
                string documentationLink = snomPhone.GetSetting(SnomSettingKeys.DocumentationLink);
                Assert.AreEqual(documentationLink, "http://wiki.snom.com/wiki/index.php/Settings/");
            }
        }

        [TestMethod]
        public void Version()
        {
            using (SnomPhone snomPhone = new SnomPhone(Settings.Default.MyPhoneIpAddress))
            {
                Version firmwareVersion = snomPhone.GetFirmwareVersion();
                Assert.AreEqual(firmwareVersion, new Version("8.4.18"));
            }
        }

        [TestMethod]
        public void PhoneType()
        {
            using (SnomPhone snomPhone = new SnomPhone(Settings.Default.MyPhoneIpAddress))
            {
                string phoneType = snomPhone.GetPhoneType();
                Assert.AreEqual(phoneType, "snom320");
            }
        }
    }
}
